{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "University of Regina Professor's salary.ipynb",
      "version": "0.3.2",
      "provenance": [],
      "collapsed_sections": [],
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/Tanu-N-Prabhu/Python/blob/master/University_of_Regina_Professor's_salary.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "OrpM1wnUGzsO",
        "colab_type": "text"
      },
      "source": [
        "# Playing with the University of Regina Professor's salary using python (Data Science)."
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "2jPzauAxHZYq",
        "colab_type": "text"
      },
      "source": [
        "**The dataset for this tutorial can be found here [University of Regina](https://www.uregina.ca/orp/assets/statistics/2018-07-11-employees-earning-100K-plus.pdf). Just download this pdf and convert this to excel with comma separated  values (.CSV). To do this just go to youtube you'll find some great tutorials out there.**"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ivosHEdsJTmn",
        "colab_type": "text"
      },
      "source": [
        "![alt text](http://i63.tinypic.com/i1b82b.jpg)\n",
        "\n",
        "\n",
        "\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "NrsnJt2Y2q0Y",
        "colab_type": "code",
        "outputId": "942d05d3-a420-400f-8ae5-c6a20279938e",
        "colab": {
          "resources": {
            "http://localhost:8080/nbextensions/google.colab/files.js": {
              "data": "Ly8gQ29weXJpZ2h0IDIwMTcgR29vZ2xlIExMQwovLwovLyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLy8geW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c3BvbnNlOiB7CiAgICAgICAgICBhY3Rpb246ICdhcHBlbmQnLAogICAgICAgICAgZmlsZTogZmlsZS5uYW1lLAogICAgICAgICAgZGF0YTogYmFzZTY0LAogICAgICAgIH0sCiAgICAgIH07CiAgICAgIHBlcmNlbnQudGV4dENvbnRlbnQgPQogICAgICAgICAgYCR7TWF0aC5yb3VuZCgocG9zaXRpb24gLyBmaWxlRGF0YS5ieXRlTGVuZ3RoKSAqIDEwMCl9JSBkb25lYDsKICAgIH0KICB9CgogIC8vIEFsbCBkb25lLgogIHlpZWxkIHsKICAgIHJlc3BvbnNlOiB7CiAgICAgIGFjdGlvbjogJ2NvbXBsZXRlJywKICAgIH0KICB9Owp9CgpzY29wZS5nb29nbGUgPSBzY29wZS5nb29nbGUgfHwge307CnNjb3BlLmdvb2dsZS5jb2xhYiA9IHNjb3BlLmdvb2dsZS5jb2xhYiB8fCB7fTsKc2NvcGUuZ29vZ2xlLmNvbGFiLl9maWxlcyA9IHsKICBfdXBsb2FkRmlsZXMsCiAgX3VwbG9hZEZpbGVzQ29udGludWUsCn07Cn0pKHNlbGYpOwo=",
              "ok": true,
              "headers": [
                [
                  "content-type",
                  "application/javascript"
                ]
              ],
              "status": 200,
              "status_text": ""
            }
          },
          "base_uri": "https://localhost:8080/",
          "height": 75
        }
      },
      "source": [
        "from google.colab import files\n",
        "uploaded = files.upload()"
      ],
      "execution_count": 4,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/html": [
              "\n",
              "     <input type=\"file\" id=\"files-f093b72b-b7cc-41ed-83d2-d0a69ce2dc2e\" name=\"files[]\" multiple disabled />\n",
              "     <output id=\"result-f093b72b-b7cc-41ed-83d2-d0a69ce2dc2e\">\n",
              "      Upload widget is only available when the cell has been executed in the\n",
              "      current browser session. Please rerun this cell to enable.\n",
              "      </output>\n",
              "      <script src=\"/nbextensions/google.colab/files.js\"></script> "
            ],
            "text/plain": [
              "<IPython.core.display.HTML object>"
            ]
          },
          "metadata": {
            "tags": []
          }
        },
        {
          "output_type": "stream",
          "text": [
            "Saving UofR.csv to UofR.csv\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "nkgKRFhlKlnx",
        "colab_type": "text"
      },
      "source": [
        "\n",
        "\n",
        "---\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Zfe1DDZX26zb",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "import pandas as pd\n",
        "import numpy as np\n",
        "import io"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "E8ciYCwAKmwi",
        "colab_type": "text"
      },
      "source": [
        "\n",
        "\n",
        "---\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "vKN2B3r022Ip",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "df2 = pd.read_csv(io.BytesIO(uploaded['UofR.csv']))\n",
        "# Dataset is now stored in a Pandas Dataframe"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "6N2WM65kKn29",
        "colab_type": "text"
      },
      "source": [
        "\n",
        "\n",
        "---\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "dkyzCLPS5LIw",
        "colab_type": "code",
        "outputId": "1b3823bf-e99a-48ee-ea56-b51b50e49cd7",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 202
        }
      },
      "source": [
        "df2.head()"
      ],
      "execution_count": 7,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Last Name</th>\n",
              "      <th>First Name</th>\n",
              "      <th>Current\n",
              "Salary</th>\n",
              "      <th>Administrative/\n",
              "Research Stipend</th>\n",
              "      <th>Market\n",
              "Supplement</th>\n",
              "      <th>Total</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>Bredohl</td>\n",
              "      <td>Thomas</td>\n",
              "      <td>135,110.00</td>\n",
              "      <td>NaN</td>\n",
              "      <td>NaN</td>\n",
              "      <td>135,110.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>Brigham</td>\n",
              "      <td>R. Mark</td>\n",
              "      <td>174,973.00</td>\n",
              "      <td>NaN</td>\n",
              "      <td>NaN</td>\n",
              "      <td>174,973.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>Britto</td>\n",
              "      <td>Sarah</td>\n",
              "      <td>133,292.00</td>\n",
              "      <td>4,150.00</td>\n",
              "      <td>NaN</td>\n",
              "      <td>137,442.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>Brotheridge</td>\n",
              "      <td>Neil</td>\n",
              "      <td>164,260.00</td>\n",
              "      <td>NaN</td>\n",
              "      <td>NaN</td>\n",
              "      <td>164,260.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>Brown</td>\n",
              "      <td>Douglas</td>\n",
              "      <td>124,952.00</td>\n",
              "      <td>NaN</td>\n",
              "      <td>NaN</td>\n",
              "      <td>124,952.00</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "     Last Name First Name  ... Market\\nSupplement       Total\n",
              "0      Bredohl     Thomas  ...                NaN  135,110.00\n",
              "1      Brigham    R. Mark  ...                NaN  174,973.00\n",
              "2       Britto      Sarah  ...                NaN  137,442.00\n",
              "3  Brotheridge       Neil  ...                NaN  164,260.00\n",
              "4        Brown    Douglas  ...                NaN  124,952.00\n",
              "\n",
              "[5 rows x 6 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 7
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "svhMuiv7KorZ",
        "colab_type": "text"
      },
      "source": [
        "\n",
        "\n",
        "---\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "6Jo7BGZy5eC4",
        "colab_type": "code",
        "colab": {}
      },
      "source": [
        "df2 = df2.replace(np.NaN, 0)"
      ],
      "execution_count": 0,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "U3IBf-88Foe0",
        "colab_type": "code",
        "outputId": "4cdc238e-001f-4a73-b1bc-91ad8282b8dc",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 355
        }
      },
      "source": [
        "df2.head(10)"
      ],
      "execution_count": 15,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Last Name</th>\n",
              "      <th>First Name</th>\n",
              "      <th>Current\n",
              "Salary</th>\n",
              "      <th>Administrative/\n",
              "Research Stipend</th>\n",
              "      <th>Market\n",
              "Supplement</th>\n",
              "      <th>Total</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>0</th>\n",
              "      <td>Bredohl</td>\n",
              "      <td>Thomas</td>\n",
              "      <td>135,110.00</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>135,110.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>1</th>\n",
              "      <td>Brigham</td>\n",
              "      <td>R. Mark</td>\n",
              "      <td>174,973.00</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>174,973.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>2</th>\n",
              "      <td>Britto</td>\n",
              "      <td>Sarah</td>\n",
              "      <td>133,292.00</td>\n",
              "      <td>4,150.00</td>\n",
              "      <td>0</td>\n",
              "      <td>137,442.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>3</th>\n",
              "      <td>Brotheridge</td>\n",
              "      <td>Neil</td>\n",
              "      <td>164,260.00</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>164,260.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>4</th>\n",
              "      <td>Brown</td>\n",
              "      <td>Douglas</td>\n",
              "      <td>124,952.00</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>124,952.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>5</th>\n",
              "      <td>Brown</td>\n",
              "      <td>Janine</td>\n",
              "      <td>96,824.00</td>\n",
              "      <td>0</td>\n",
              "      <td>11,180.00</td>\n",
              "      <td>108,004.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>6</th>\n",
              "      <td>Bruno</td>\n",
              "      <td>Paul</td>\n",
              "      <td>109,851.00</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>109,851.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>7</th>\n",
              "      <td>Buehler</td>\n",
              "      <td>Alex</td>\n",
              "      <td>109,761.00</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>109,761.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>8</th>\n",
              "      <td>Bundock</td>\n",
              "      <td>Chris</td>\n",
              "      <td>106,571.00</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>106,571.00</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <th>9</th>\n",
              "      <td>Burlingham</td>\n",
              "      <td>Clay</td>\n",
              "      <td>106,571.00</td>\n",
              "      <td>0</td>\n",
              "      <td>0</td>\n",
              "      <td>106,571.00</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "     Last Name First Name  ... Market\\nSupplement       Total\n",
              "0      Bredohl     Thomas  ...                  0  135,110.00\n",
              "1      Brigham    R. Mark  ...                  0  174,973.00\n",
              "2       Britto      Sarah  ...                  0  137,442.00\n",
              "3  Brotheridge       Neil  ...                  0  164,260.00\n",
              "4        Brown    Douglas  ...                  0  124,952.00\n",
              "5        Brown     Janine  ...          11,180.00  108,004.00\n",
              "6        Bruno       Paul  ...                  0  109,851.00\n",
              "7      Buehler       Alex  ...                  0  109,761.00\n",
              "8      Bundock      Chris  ...                  0  106,571.00\n",
              "9   Burlingham       Clay  ...                  0  106,571.00\n",
              "\n",
              "[10 rows x 6 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 15
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "7q5SXExfKqKt",
        "colab_type": "text"
      },
      "source": [
        "\n",
        "\n",
        "---\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "UvdHv1KzJxqV",
        "colab_type": "text"
      },
      "source": [
        "**Thanks to StackOverflow for helping me with the capatilize() - which capitalizes the first letter of the word in whichever format you write, whereas the str.contain() - is used to match the string that we are looking for. So this acts as a search engine, wherein you can search for the name of the prof that you want and you'll get your answer. Make sure that you enter the first name of the professor that you are looking for.**"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "HKXB-leQ_Tfl",
        "colab_type": "code",
        "outputId": "88565a10-fc03-4f30-f8ed-499f53e07f95",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 97
        }
      },
      "source": [
        "name = input(\"Enter the first name of the prof that you want to search\")\n",
        "name = name.capitalize()\n",
        "\n",
        "df2[df2['First Name'].str.contains(name)]"
      ],
      "execution_count": 16,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Enter the first name of the prof that you want to searchCortney\n"
          ],
          "name": "stdout"
        },
        {
          "output_type": "execute_result",
          "data": {
            "text/html": [
              "<div>\n",
              "<style scoped>\n",
              "    .dataframe tbody tr th:only-of-type {\n",
              "        vertical-align: middle;\n",
              "    }\n",
              "\n",
              "    .dataframe tbody tr th {\n",
              "        vertical-align: top;\n",
              "    }\n",
              "\n",
              "    .dataframe thead th {\n",
              "        text-align: right;\n",
              "    }\n",
              "</style>\n",
              "<table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              "    <tr style=\"text-align: right;\">\n",
              "      <th></th>\n",
              "      <th>Last Name</th>\n",
              "      <th>First Name</th>\n",
              "      <th>Current\n",
              "Salary</th>\n",
              "      <th>Administrative/\n",
              "Research Stipend</th>\n",
              "      <th>Market\n",
              "Supplement</th>\n",
              "      <th>Total</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <th>14</th>\n",
              "      <td>Butz</td>\n",
              "      <td>Cortney</td>\n",
              "      <td>164,008.00</td>\n",
              "      <td>10,000.00</td>\n",
              "      <td>0</td>\n",
              "      <td>174,008.00</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table>\n",
              "</div>"
            ],
            "text/plain": [
              "   Last Name First Name  ... Market\\nSupplement       Total\n",
              "14      Butz    Cortney  ...                  0  174,008.00\n",
              "\n",
              "[1 rows x 6 columns]"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 16
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "7yXRElXOKrcH",
        "colab_type": "text"
      },
      "source": [
        "\n",
        "\n",
        "---\n",
        "\n"
      ]
    }
  ]
}